$OpenBSD: patch-pjmedia_src_pjmedia-codec_speex_codec_c,v 1.1 2012/06/05 23:15:23 fgsch Exp $
--- pjmedia/src/pjmedia-codec/speex_codec.c.orig	Tue Jul 19 04:42:28 2011
+++ pjmedia/src/pjmedia-codec/speex_codec.c	Sun Jun  3 04:09:23 2012
@@ -379,6 +379,7 @@ PJ_DEF(pj_status_t) pjmedia_codec_speex_deinit(void)
     if (!codec_mgr) {
 	pj_pool_release(spx_factory.pool);
 	spx_factory.pool = NULL;
+	pj_mutex_unlock(spx_factory.mutex);
 	return PJ_EINVALIDOP;
     }
 
@@ -387,6 +388,7 @@ PJ_DEF(pj_status_t) pjmedia_codec_speex_deinit(void)
 						  &spx_factory.base);
     
     /* Destroy mutex. */
+    pj_mutex_unlock(spx_factory.mutex);
     pj_mutex_destroy(spx_factory.mutex);
 
     /* Destroy pool. */
